#pragma once
#ifndef CPAIRED_READ_SET_H_
#define CPAIRED_READ_SET_H_
#include "LongReadInBits.h"
#include "ReadsFileParser.h"
#include "ReadInBits.h"
#include "ColorSpaceRead.h"
#include "ShortReadUtil.h"
#include "MismatchScores.h"
#include "ReadsQualScores.h"
#include <vector>
#include <iostream>
#include <string>
using namespace std;

class CLongReadsSet
{
public:
    CLongReadsSet(void);
    CLongReadsSet(unsigned int Capacity, unsigned int uiReadLength);
    // Generate set given a file with reads and readLength (must be known in advance)
    CLongReadsSet(const char* InputFile, CReadsSetParam& readsOpt);
    virtual ~CLongReadsSet();
    unsigned int get_next_capacity_reads(int capacity, char sep = ',');
    int clear(int capacity = 0);

    vector<CLongReadInBits>  longReadsInBits;
    vector<CReadID> readsId;
    unsigned int  uiRead_Length;
    unsigned int  uiNo_of_Reads;
    unsigned int  uiNo_of_Bad_Reads;
    bool bIgnoreQScores;
    // A char flag used to record the input file type, example F for fasta, S for .seq.txt, A for .realign
    char cFileType;
    char InputFile[FILENAME_MAX];
    // Keep the info of the quality score
    CReadsQualScores* pQualScores;
protected:
    // get reads from the file and store (append) in a vector. Return how many reads are read-in.
    unsigned int openAFileReady2GetRead(const char* InputFile, const CReadsSetParam& opt);
    bool save_next_read(bool bSOLiDReadFormat, bool getQScores, char sep, bool debug = false);
    void save_next_read_id(const char* tagLine, char sep = ',');
    CReadsFileParser parser;
    CReadsSetParam parm;
private:
    int initialization(void);
    void handleBadread(void);
};
#endif
